﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shrestha.Data.EventModel;
using Microsoft.Maps.MapControl.WPF;

namespace Shrestha.Data.Database
{
    /// <summary>
    /// Since these two functions have been used to extract information out of the DB, if you wish to use some other DB like Oracle,PostGRES please make sure you implement this interface.
    /// </summary>
    public interface IDbManager
    {
        /// <summary>
        /// This function returns the connection object eg. MySqlConnection to the caller function. Fails if there aren't sufficient privileges to the user
        /// </summary>
        /// <param name="host">Host Ip Address</param>
        /// <param name="db">Database Name</param>
        /// <param name="user">Username</param>
        /// <param name="password">Password</param>
        /// <returns>Connection object</returns>
        object GetConnection(string host, string db, string user, string password);

        /// <summary>
        /// This function executes the query and returns a reader object eg. MySqlDataReader
        /// </summary>
        /// <param name="query">Query Text</param>
        /// <param name="ConnectionObject">Connection Object eg. MySqlConnection</param>
        /// <returns>Data reader eg. MySqlDataReader</returns>
        TriEventCollection Execute3Query(String query, object ConnectionObject);

        List<string> GetTableNames(object ConnectionObject);
        List<string> GetColumnNames(object ConnectionObject, object TableName);    
    }
}
